﻿<%@ Page Title="View My Apps" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="AppsList.aspx.vb" Inherits="iRateMyApps.List" %>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    
    <h2>List of Apps</h2>
    <br />

    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="ID" OnRowCreated="OnRowCreated">
    <Columns>
        <asp:BoundField DataField="AppName" HeaderText="App" SortExpression="AppName" >
        <HeaderStyle HorizontalAlign="Right" />
        <ItemStyle Width="150px" />
        </asp:BoundField>
        <asp:BoundField DataField="DeveloperName" HeaderText="Developer" SortExpression="DeveloperName" >
        <ItemStyle Width="150px" />
        </asp:BoundField>
        <asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" >
        <ItemStyle Width="100px" />
        </asp:BoundField>
        <asp:HyperLinkField DataNavigateUrlFields="AppId" DataNavigateUrlFormatString="https://itunes.apple.com/us/app/id{0}" HeaderText="Itunes Link" Text="Go to Itunes Store" >
        <ItemStyle Width="150px" />
        </asp:HyperLinkField>
        <asp:TemplateField HeaderText="Pictures">
             <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ID", "AppsDetail.aspx?ID={0}") %>'>
                        <img src='<%# Eval("Thumbnails") %>'  alt="No picture found"  width="100" height="100" style="border-style: solid; border-width: medium" />
                    </asp:HyperLink>
                </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AppsDatabaseConnectionString %>" ProviderName="<%$ ConnectionStrings:AppsDatabaseConnectionString.ProviderName %>" SelectCommand="SELECT [ID], [AppName], [Description], [Review], [UserRating], [Type], [DeveloperName], [Pictures], [Thumbnails], [AppId] FROM [AppsDatabase]"></asp:SqlDataSource>
</asp:Content>
